package com.manor.paradise.http

import com.manor.common.CommonAppConfig
import com.manor.common.http.HttpCallback
import com.manor.common.http.HttpClient
import com.manor.common.http.JHttpCallback
import com.manor.common.http.PitUtil
import java.math.BigDecimal

/**

 * @version 1.0

 * @date 2020/6/22  13:41
 */
object ElvesHttpUtil {

    /**
     * 取消网络请求
     */
    fun cancel(tag: String?) {
        HttpClient.getInstance().cancel(tag)
    }

    var size = 20


    /**
     * 示例
     */
    fun getSvVideoList(dId: String, p: Int, uid: String = "", commentId: String = "", callback: HttpCallback?) {
        HttpClient.getInstance()["Short.GetDynamicList", ElvesHttpConst.GET_SV_COMMENT_LIST]
                .params("uid", CommonAppConfig.getInstance().uid)
                .params("id", dId)
                .params("p", p)
                .params("uids", uid)
                .params("commentid", commentId)
                .execute(callback)
    }

    /**
     * 卖米粒
     */
    fun getOpenShop(crystalOreNum: BigDecimal, sdCoupons: BigDecimal, unit: BigDecimal, payPwd: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["crystalOreNum"] = crystalOreNum
        map["sdCoupons"] = sdCoupons
        map["unit"] = unit
        map["payPwd"] = payPwd

        HttpClient.getInstance().Jpost("admin-transfer/app/market/v5/open-shop/sell", ElvesHttpConst.POST_OPEN_SHOP_SELL)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 收购米粒
     */
    fun getAcquisitionShop(crystalOreNum: BigDecimal, sdCoupons: BigDecimal, unit: BigDecimal, payPwd: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["crystalOreNum"] = crystalOreNum
        map["sdCoupons"] = sdCoupons
        map["unit"] = unit
        map["payPwd"] = payPwd

        HttpClient.getInstance().Jpost("admin-transfer/app/market/v5/open-shop/buy", ElvesHttpConst.POST_OPEN_SHOP_BUY)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 集市列表
     * @param current     页码
     * @param endNum     米粒结束数量
     * @param size     店铺等级类型(1小店铺 2大店铺)
     * @param startNum     每页条数
     * @param status    米粒开始数量
     * @param uid     店家用户id
     */
    fun getMarketList(current: Int, endNum: Int, shopType: Int, size: Int, startNum: Int, saleType: Int, uid: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["current"] = current
        if (shopType != 0) {
            map["shopType"] = shopType
        }

        map["size"] = size
        //jsonObject.put("uid", CommonAppConfig.getInstance().uid)
        if (endNum != 0) {
            map["endNum"] = endNum
        }
        if (startNum != 0) {
            map["startNum"] = startNum
        }
        if (saleType != 0) {
            map["saleType"] = saleType
        }
        if (!uid.equals("")) {
            map["uid"] = uid
        } else {
            map["uid"] = ""
        }

        HttpClient.getInstance().Jpost("admin-transfer/app/market/v5/shop/list", ElvesHttpConst.POST_OPEN_SHOP_LIST)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     *我雇佣的精灵（精灵矿山）
     * @param crystalOreNum BigDecimal
     * @param sdCoupons BigDecimal
     * @param unit BigDecimal
     * @param callback JHttpCallback?
     */
    fun getSpiritHave(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        HttpClient.getInstance().Jpost("admin-transfer/app/hire-spirit/v1/have", ElvesHttpConst.POST_OPEN_SHOP_PRICE)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     *获取有效精灵数与米粒、能量数（精灵矿山）
     * @param crystalOreNum BigDecimal
     * @param sdCoupons BigDecimal
     * @param unit BigDecimal
     * @param callback JHttpCallback?
     */
    fun getSpiritCount(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        HttpClient.getInstance()
                .Jpost("admin-hire-query/app/spirit-mine/v1/get-spirit-count-assets", ElvesHttpConst.POST_SPIRIT_COUNT)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 用户精灵财产表
     */
    fun getParadiseInfo(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["uid"] = CommonAppConfig.getInstance().uid
        HttpClient.getInstance().Jpost("admin-transfer/app/assets/v1/get-assets-info-by-uid", ElvesHttpConst.POST_OPEN_SHOP_BY_UID)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 跳过平台现金任务
     */
    fun getSkipElves(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/assets/v1/skip-platform-cash-task", ElvesHttpConst.POST_SKIP_TASK)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 获取转增页面均价信息
     */
    fun getAvgpiceInfo(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["uid"] = CommonAppConfig.getInstance().uid
        HttpClient.getInstance()
                .Jpost("admin-give/app/turn-to-increase/v1/get-avg-price-info", ElvesHttpConst.POST_OPEN_SHOP_BY_INFO)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 转增
     */
    fun getIncrease(crystalOre: BigDecimal, payPwd: String, uid: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["crystalOre"] = crystalOre
        map["payPwd"] = payPwd
        map["uid"] = uid//对方id
        HttpClient.getInstance()
                .Jpost("admin-give/app/turn-to-increase/v1/deal", ElvesHttpConst.POST_OPEN_SHOP_BY_DEAL)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 转增
     */
    fun getSearchNo(serialNo: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["serialNo"] = serialNo
        HttpClient.getInstance()
                .Jpost("admin-transfer/app/assets/v1/get-user-info-by-serial-no", ElvesHttpConst.POST_OPEN_SHOP_BY_DEAL)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 修改交易密码
     */
    fun getEdpassword(newPwd: String, oldPwd: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["newPwd"] = newPwd
        map["oldPwd"] = oldPwd
        HttpClient.getInstance()
                .Jpost("admin-transfer/app/assets/v1/update-pay-password", ElvesHttpConst.POST_OPEN_PASSWORD)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     *
     * @param crystalOreNum Int买/卖多少个星矿
     * @param payPwd Int交易密码
     * @param sdCouponsNum Int需支付多少嗨券[只做比对]/得多少嗨券[只做比对]
     * @param shopId Int店铺id
     * @param callback JHttpCallback?
     */
    fun getBuyingOre(crystalOreNum: BigDecimal, payPwd: String, sdCouponsNum: BigDecimal, shopId: BigDecimal, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["uid"] = CommonAppConfig.getInstance().uid
        map["crystalOreNum"] = crystalOreNum
        map["payPwd"] = payPwd
        map["sdCouponsNum"] = sdCouponsNum
        map["shopId"] = shopId
        HttpClient.getInstance()
                .Jpost("admin-transfer/app/market/v5/transaction/sell", ElvesHttpConst.POST_OPEN_SHOP_T_SELL)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     *
     * @param crystalOreNum Int买/卖多少个星矿
     * @param payPwd Int交易密码
     * @param sdCouponsNum Int需支付多少嗨券[只做比对]/得多少嗨券[只做比对]
     * @param shopId Int店铺id
     * @param callback JHttpCallback?
     */
    fun getBuyingBuy(crystalOreNum: BigDecimal, payPwd: String, sdCouponsNum: BigDecimal, shopId: BigDecimal, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["uid"] = CommonAppConfig.getInstance().uid
        map["crystalOreNum"] = crystalOreNum
        map["payPwd"] = payPwd
        map["sdCouponsNum"] = sdCouponsNum
        map["shopId"] = shopId
        HttpClient.getInstance()
                .Jpost("admin-transfer/app/market/v5/transaction/buy", ElvesHttpConst.POST_OPEN_SHOP_TBUY)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 我的雇佣精灵
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getMyhire(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance()
                .Jpost("admin-transfer/app/hire-spirit/v1/user-spirit-list", ElvesHttpConst.POST_OPEN_HIRE_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 爱心奖励
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getMyHeart(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance()
                .Jpost("admin-task/app/backfall/v1/select-page-list", ElvesHttpConst.POST_OPEN_HIRE_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 我的雇佣记录
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getMyhirelist(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance()
                .Jpost("admin-transfer/app/hire-spirit/v1/user-spirit-history-list", ElvesHttpConst.POST_OPEN_HIRE_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 我的雇佣记录
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getAnimaInfoNew(current: Int, bHire: Boolean, finishTask: Boolean, isauth: Boolean, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        map["bhire"] = bHire
        map["bfinishTask"] = finishTask
        map["bisauth"] = isauth

        HttpClient.getInstance()
                .Jpost("admin-hire-query/app/assets/v1/get-lower-list-anima-info", ElvesHttpConst.POST_OPEN_LOWER_LIST_INFO)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 获取下级直推灵气指数列表信息
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getLowerInviteList(current: Int, id: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        map["uid"] = id

        HttpClient.getInstance()
                .Jpost("admin-hire-query/app/assets/v1/get-lower-invite-list", ElvesHttpConst.POST_LOWER_LIST_INFO)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 任务记录
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getTaskList(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance()
                .Jpost("admin-task/app/honey/v1/task-record-list", ElvesHttpConst.POST_OPEN_USER_ANIMA_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 获取广告信息
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getTaskVideo(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["showid"] = 10001
        map["index"] = 0
        HttpClient.getInstance()
                .Jpost("admin-config/app/adv/v5/get-info", ElvesHttpConst.POST_OPEN_USER_ANIMA_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 获取活跃度信息
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getGetInfo(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        HttpClient.getInstance().Jpost("admin-data/app/anima/v1/get-anima-info", ElvesHttpConst.POST_OPEN_GET_INFO)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 获取蜜糖做任务
     * @param current Int
     * @param callback JHttpCallback?
     * 废弃
     */
    @Deprecated("废弃")
    fun getTask(taskId: String, type: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["taskId"] = taskId
        map["type"] = type
        HttpClient.getInstance()
                .Jpost("admin-dotask/app/spirit/v1/finish-task", ElvesHttpConst.POST_OPEN_TASK)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 获取蜜糖页面数值
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getAssetsValue(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        HttpClient.getInstance()
                .Jpost("admin-transfer/app/assets/v1/page-value-num", ElvesHttpConst.POST_OPEN_PAGE_VALUE)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 我的活跃度
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getdetailsList(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance()
                .Jpost("admin-task/app/honey/v1/user-anima-details-record-list", ElvesHttpConst.POST_OPEN_USER_ANIMA_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 获取用户流失加成灵气值记录列表
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getLossList(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance()
                .Jpost("admin-task/app/honey/v1/loss-anima/details-list", ElvesHttpConst.POST_OPEN_USER_ANIMA_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }



    /**
     * 礼物列表
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getGiftList(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        map["uid"] = CommonAppConfig.getInstance().uid
        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/gift/v1/gift-list", ElvesHttpConst.POST_OPEN_NPC_SHOP_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 贵族列表
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getNoble(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        map["uid"] = CommonAppConfig.getInstance().uid

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/noble/v1/noble-list", ElvesHttpConst.POST_OPEN_NPC_SHOP_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 购买贵族
     * @param giftId String 礼品id
     * @param phone String 手机号码
     * @param num Int 购买数量
     * @param sdCoupons String 所需嗨券
     * @param payPwd String 交易密码
     * @param bLogistics String 有没有收货地址 是否需要发货
     * @param logisticsAddrId String 用户收货地址id
     * @param logisticsNo String 物流单号
     * @param callback JHttpCallback?
     */
    fun getPlayNoble(giftId: String, buyDuration: Int, sdCoupons: BigDecimal, payPwd: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["id"] = giftId
        map["buyDuration"] = buyDuration
        map["sdCoupons"] = sdCoupons
        map["payPwd"] = payPwd

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/noble/v1/buy-noble", ElvesHttpConst.POST_OPEN_NPC_SHOP_BUY)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 购买礼物
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getPropsList(payPwd: String, propsId: String, sdCoupons: BigDecimal, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["payPwd"] = payPwd
        map["propsId"] = propsId
        map["sdCoupons"] = sdCoupons.toString()

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/props/v1/buy-props", ElvesHttpConst.POST_OPEN_SHOP_PROPS_BUY)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 我的收货地址
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getAddrList(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        map["uid"] = CommonAppConfig.getInstance().uid

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/logistics-addr/v1/address-list", ElvesHttpConst.POST_OPEN_ADDR_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 新增收货地址
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getAddrlogistics(address: String, areaCode: String, areaName: String, cityCode: String, cityName: String, contacts: String, mobile: String, provinceCode: String, provinceName: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["address"] = address
        map["areaCode"] = areaCode
        map["areaName"] = areaName

        map["cityCode"] = cityCode
        map["cityName"] = cityName
        map["contacts"] = contacts
        map["mobile"] = mobile
        map["provinceCode"] = provinceCode
        map["provinceName"] = provinceName

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/logistics-addr/v1/add-address", ElvesHttpConst.POST_OPEN_ADDR_ADD)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 修改收货地址
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getEdlogistics(id: String, address: String, areaCode: String, areaName: String, cityCode: String, cityName: String, contacts: String, mobile: String, provinceCode: String, provinceName: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["id"] = id
        map["address"] = address
        map["areaCode"] = areaCode
        map["areaName"] = areaName

        map["cityCode"] = cityCode
        map["cityName"] = cityName
        map["contacts"] = contacts
        map["mobile"] = mobile
        map["provinceCode"] = provinceCode
        map["provinceName"] = provinceName

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/logistics-addr/v1/update-address", ElvesHttpConst.POST_OPEN_ADDR_UP)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 设为默认
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getUpdateDefault(id: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["id"] = id

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/logistics-addr/v1/update-default-address", ElvesHttpConst.POST_OPEN_ADDR_DEF)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 删除收货地址
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getDelete(id: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["id"] = id

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/logistics-addr/v1/del-address", ElvesHttpConst.POST_OPEN_ADDR_DEL)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 购买礼物
     * @param giftId String 礼品id
     * @param phone String 手机号码
     * @param num Int 购买数量
     * @param sdCoupons String 所需嗨券
     * @param payPwd String 交易密码
     * @param bLogistics String 有没有收货地址 是否需要发货
     * @param logisticsAddrId String 用户收货地址id
     * @param logisticsNo String 物流单号
     * @param callback JHttpCallback?
     */
    fun getGiftBuy(giftId: String, phone: String, num: BigDecimal, sdCoupons: BigDecimal, payPwd: String, bLogistics: Boolean, logisticsAddrId: String, logisticsNo: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["giftId"] = giftId
        map["phone"] = phone
        map["num"] = num.toString()
        map["sdCoupons"] = sdCoupons.toString()
        map["payPwd"] = payPwd
        map["blogistics"] = bLogistics
        map["logisticsAddrId"] = logisticsAddrId
        map["logisticsNo"] = logisticsNo

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/gift/v1/buy-gift", ElvesHttpConst.POST_OPEN_GIFT_BUY)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 返回默认收货地址
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getDefaults(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        HttpClient.getInstance()
                .Jpost("admin-transfer/app/npc-shop/logistics-addr/v1/defaults-address", ElvesHttpConst.POST_OPEN_SPIRIT_INFO)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 精灵详情
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getMineralInfo(id: BigDecimal, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["id"] = id

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/spirit/v1/get-info-by-user", ElvesHttpConst.POST_OPEN_SPIRIT_INFO)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 雇佣精灵
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getHire(id: BigDecimal, payPwd: String, payType: Boolean, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["id"] = id
        map["payPwd"] = payPwd
        if (payType) {
            map["payType"] = 1
        } else {
            map["payType"] = 2
        }


        HttpClient.getInstance()
                .Jpost("admin-transfer/app/spirit/v1/hire-spirit", ElvesHttpConst.POST_OPEN_SPIRIT_HIRE)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 雇佣奖励精灵(免费)
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getHireReward(payPwd: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["payPwd"] = payPwd

        HttpClient.getInstance()
                .Jpost("admin-transfer/app/spirit/v1/hire-reward-spirit", ElvesHttpConst.POST_OPEN_HIRE_REWARD)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 能量明细
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getCrystalList(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance()
                .Jpost("admin-task/app/crystal/v1/details-list", ElvesHttpConst.POST_OPEN_DETAILS_LIST)
                //    .upString(String.valueOf(mGson.toJson(params)),JSON)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 米粒明细
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getOresList(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance().Jpost("admin-task/app/ore/v1/details-list", ElvesHttpConst.POST_OPEN_ORE_LIST)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 米壳明细
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getStartPointList(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance().Jpost("admin-task/app/star-point/v1/select-page-list", ElvesHttpConst.POST_OPEN_ORE_LIST)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     * 转赠赠出明细
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getExpend(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance()
                .Jpost("admin-give/app/turn-to-increase/v1/details-info/expend",
                        ElvesHttpConst.POST_OPEN_EXPEND)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 转赠赠出明细
     * @param current Int
     * @param callback JHttpCallback?
     */
    fun getIncome(current: Int, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["size"] = size
        map["current"] = current
        HttpClient.getInstance()
                .Jpost("admin-give/app/turn-to-increase/v1/details-info/income", ElvesHttpConst.POST_OPEN_INCOME)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     * 获取活体检测的token
     * （无参数）
     * /v1/ali-face-token
     */
    fun getAliLiveToken(callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        HttpClient.getInstance()
                .Jpost("admin-face/app/face/v1/ali-face-token", ElvesHttpConst.POST_ALILIVE_TOKEN)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }

    /**
     *将获取获取检测的结果回传到服务器
     *
     *@param faceID
     *faceId : 人脸id
     *
     * */
    fun pushFaceId(faceId: String, callback: JHttpCallback?) {
        val map = linkedMapOf<String, Any>()
        map["faceId"] = faceId
        HttpClient.getInstance()
                .Jpost("admin-face/app/face/v1/ali-face-result", ElvesHttpConst.POST_PUSH_FACEID)
                .upRequestBody(PitUtil.getBody(map))
                .execute(callback)
    }


    /**
     *公共参数
     *User.getFaceInfo
     *status
     * */
    fun checkPayStatus(callback: HttpCallback?) {
        HttpClient.getInstance()
                .post("User.getFaceInfo", ElvesHttpConst.POST_CHECK_PAY_STATUS)
                .params("uid", CommonAppConfig.getInstance().getUid())
                .params("token", CommonAppConfig.getInstance().getToken())
                .execute(callback)
    }
}